package com.jzt.jk.open.api.manage.infrastructure.common.config;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.context.properties.NestedConfigurationProperty;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

/**
 * 作者：lizw <br/>
 * 创建时间：2021/01/21 11:05 <br/>
 */
@ConfigurationProperties(prefix = GlobalConfig.ConfigPrefix)
@Data
public class GlobalConfig implements Serializable {
    public static final String ConfigPrefix = "open-api-manage";

    /**
     * 不需要认证和授权的Path(支持Ant风格的Path)
     */
    private final List<String> ignorePaths = new ArrayList<>();
    /**
     * 不需要授权的Path(支持Ant风格的Path)
     */
    private final List<String> ignoreAuthPaths = new ArrayList<>();

    /**
     * 密码AES加密 key(Hex编码)
     */
    private String passwordAesKey = "b9049bb512f6b776835b9bf9e6c44c45";
    /**
     * 密码AES加密 iv(Hex编码)
     */
    private String passwordAesIv = "47e2cf4f8ee69fd9d7f3cad475682df8";

    /**
     * token配置(JWT-Token有效)
     */
    @NestedConfigurationProperty
    private final TokenConfig tokenConfig = new TokenConfig();
}
